package com.example.stmp.Mapper;

import com.example.stmp.Entity.TeachClass;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface TeachClassMapper {

    /*
     * 新增教学班级
     * */
    void insert(TeachClass teachClass);

    /*
     * 根据tcId查询教学班级状态
     * */
    @Select("select status from teachclass where tc_id = #{tcId}")
    int selectDepartStatusById(String tcId);

    /*
     * 根据tcId修改status
     * */
    @Update("update teachclass set status = #{status} where tc_id = #{tcId}")
    void updateDepartStatus(String tcId, int status);

    /*
     * 根据tcId查询教学班级信息
     * */
    TeachClass selectTeachClassInfoById(String tcId);

    /*
     * 修改教学班信息
     * */
    void update(TeachClass teachClass);

    /*
     * 查询教学班级总数
     * */
    @Select("select count(*) from teachclass where status = 1")
    Long selectcount();

    /*
     * 教学班级分页查询
     * */
    List<TeachClass> pageQuery(int startIndex, Integer pageSize);
}
